<template>
  <view class="oto-tabbar-fit" :style="[getCustomStyle]">
    <slot></slot>
  </view>
</template>

<script>
  import { toFixedCustomTabbarHeight, toFixedCustomTabbarPadding } from '../utils/index';

  export default {
    name: 'OtoTabbarFit',
    props: {
      customStyle: {
        type: Object,
        default() {
          return {};
        }
      }
    },
    data() {
      return {};
    },
    computed: {
      getCustomStyle() {
        const { customStyle } = this;
        const mergeStyle = {
          width: '100%',
          ...customStyle
        };
        mergeStyle.height = toFixedCustomTabbarHeight();
        mergeStyle.paddingBottom = toFixedCustomTabbarPadding();
        console.log('mergeStyle', mergeStyle);
        return mergeStyle;
      }
    }
  };
</script>

<style lang="scss" scoped>
  .oto-tabbar-fit {
  }
</style>
